# def my_func():定义函数名
#     my_func = 'Hello Python' 函数封装的代码
#     for i in range(10):
#         print(my_func)
# my_func(num)
# num = int(input('输入一个数:'))
# def my_test(num):
#     if num % 2 == 0:
#         return 'True'
#     else:
#         return 'False'
# print(my_test(4))
# n = int(input('输入一个数:'))
# def sum_test(n):
#     result = 0
#     for i in range(1,n+1):
#         result += i
#     print(f'result:{result}')
# sum_test(5)
# #定义函数名
# def triangle_test(a,b,c):
#     if (a+b > c) and (b+c >a) and (a+c > b):
#         if a == b == c:
#             print('等边三角形')
#         elif a == b or b == c or a == c:
#             print('等腰三角形')
#         else:
#             print('普通三角形')
#     else:
#         print('不是三角形')
# triangle_test(3,4,3)
#四个函数最后运算,add()+sub()
def add(a,b):
    result = a + b
    return result
def sub(a,b):
    result = a - b
    return result
def mul(a,b):
    result = a * b
    return result
def div(a,b):
    result = a / b
    return result
def calc(n1,n2):
    n1 = int(input('请输入一个数字'))
    n2 = int(input('再输入一个数字'))
    p = input('选择一个运算符')
    if p == '+':
        result = add(n1,n2)
    elif p == '-':
        result = sub(n1,n2)
    elif p =='*':
        result = mul(n1,n2)
    elif p == '/':
        result =div(n1,n2)
    print(f'result={result}')
calc(2,3)
